package com.salton123.soulove.biz_bmob.aty

import android.os.Bundle
import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.salton123.soulove.biz_bmob.R
import com.salton123.soulove.common.Constants


import com.salton123.ui.base.BaseActivity
import kotlinx.android.synthetic.main.login_main.*

/**
 * @Time:2021/2/3 15:51
 * @Author:wujinsheng
 * @Description:
 */
@Route(path = Constants.Router.Bmob.LOGIN_MAIN)
class LoginMainAcitivity : BaseActivity() {
    override fun initViewAndData(savedInstanceState: Bundle?) {
        setListener(btnLogin, btnRegister, tvTermsOfService)
    }

    override fun enableTitleBar(): Boolean = false

    override fun getLayoutId(): Int = R.layout.login_main

    override fun onClick(v: View?) {
        super.onClick(v)
        when (v) {
            btnLogin -> {
                var path = Constants.Router.Bmob.LOGIN
                ARouter.getInstance()
                    .build(path)
                    .navigation(activity())
            }
            btnRegister -> {
                var path = Constants.Router.Bmob.REGISTER
                ARouter.getInstance()
                    .build(path)
                    .navigation(activity())
            }
            tvTermsOfService -> {
                var path = Constants.Router.Bmob.TERMS
                ARouter.getInstance()
                    .build(path)
                    .navigation(activity())
            }
        }
    }
}